﻿using ReactiveUI;
using System;
using System.Windows;
using System.Reactive.Linq;
using System.Reactive;

namespace _03_WimForms_Commands
{
    public class MainViewModel : ReactiveObject
    {
        private string _applicationTitle;

        /// <summary>
        /// 标题名称
        /// </summary>
        public string ApplicationTitle
        {
            get => _applicationTitle;
            set => this.RaiseAndSetIfChanged(ref _applicationTitle, value);
        }
        
        /// <summary>
        /// 无参数命令
        /// </summary>
        public ReactiveCommand<object, object> ParameterlessCommand
        {
            get;
        }

        public MainViewModel()
        {
            //标题
            ApplicationTitle = "Commands命令测试";
            // 创建无参数命令
        }
       
        private void Parameterless()
        {
            MessageBox.Show("You pressed the button!", ApplicationTitle, MessageBoxButton.OK);
        }


    }

}
